<?php
/**
 * 
 *
 * @author Judas <judasnow@gmail.com>
 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
 */
session_start();
require_once( 'path.php' );
require_once( SOJ_ROOT.'/include/function/lib.php' );

@$request = $_GET;
@$problem_no = $request['problem_no'];

try {

$db = db_connect();
$problem = new problem_process( $db ) ;
$problem->load( 'problem_no' , $problem_no ); 

$title = $problem->get('title');
$source = $problem->get('source');
$content = $problem->get('content');
$best_user = $problem->get('best_user');
$time_limit = $problem->get('time_limit');
$mem_limit = $problem->get('mem_limit');
$input = $problem->get('input');
$output = $problem->get('output');
$sample_input = $problem->get('sample_input');
$sample_output = $problem->get('sample_output');
$tip = $problem->get('tip');

$tpl = new my_smarty();

$tpl->assign( 'problem_no' , $problem_no );
$tpl->assign( 'title' , $title );
$tpl->assign( 'source' , $source );
$tpl->assign( 'best_user' , $best_user );
$tpl->assign( 'time_limit' , $time_limit );
$tpl->assign( 'mem_limit' , $mem_limit );
$tpl->assign( 'content' , $content );
$tpl->assign( 'input' , $input );
$tpl->assign( 'output' , $output );
$tpl->assign( 'sample_input' , $sample_input );
$tpl->assign( 'sample_output' , $sample_output );
$tpl->assign( 'tip' , $tip );

//此参数控制不会在应引用页面显示提交代码的信息
//@see mod_problem_detail.tpl
$tpl->assign( 'ref' , ture );

$tpl->display('mod_problem_detail.tpl');

}catch( Exception $e ){
	
	 exception_handle( $e ) ;

}

